<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-10-18
 * Time: 13:59
 */

namespace app\manage\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Position extends Validate
{
    //定义验证规则
    protected $rule = [
        'name|位置名称' => 'require',
        'name_key|位置名称标识' => 'require|unique:qt_banner_position',
        'is_flash|是否轮播' => 'require',
        //'url|是否轮播' => 'require',
        '__token__' => 'token',
    ];

    //定义验证提示
    protected $message = [
        'name.require' => '请输入位置名称',
        'name_key.require' => '请输入位置名称标识',
        'is_flash.require' => '请选择是否轮播',
        //'url.require' => '请输入路由',

    ];

    //定义验证场景
    protected $scene = [
        //更新
        'update' => ['name', 'name_key', 'is_flash','url'],
    ];
}
